package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementIsisPortMeasureMapper;
import com.ruoyi.net.domain.ElementIsisPortMeasure;
import com.ruoyi.net.service.IElementIsisPortMeasureService;

/**
 * 网元-ISIS接口配置-宽度量配置Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementIsisPortMeasureServiceImpl implements IElementIsisPortMeasureService 
{
    @Autowired
    private ElementIsisPortMeasureMapper elementIsisPortMeasureMapper;

    /**
     * 查询网元-ISIS接口配置-宽度量配置
     * 
     * @param id 网元-ISIS接口配置-宽度量配置主键
     * @return 网元-ISIS接口配置-宽度量配置
     */
    @Override
    public ElementIsisPortMeasure selectElementIsisPortMeasureById(String id)
    {
        return elementIsisPortMeasureMapper.selectElementIsisPortMeasureById(id);
    }

    /**
     * 查询网元-ISIS接口配置-宽度量配置列表
     * 
     * @param elementIsisPortMeasure 网元-ISIS接口配置-宽度量配置
     * @return 网元-ISIS接口配置-宽度量配置
     */
    @Override
    public List<ElementIsisPortMeasure> selectElementIsisPortMeasureList(ElementIsisPortMeasure elementIsisPortMeasure)
    {
        return elementIsisPortMeasureMapper.selectElementIsisPortMeasureList(elementIsisPortMeasure);
    }

    /**
     * 新增网元-ISIS接口配置-宽度量配置
     * 
     * @param elementIsisPortMeasure 网元-ISIS接口配置-宽度量配置
     * @return 结果
     */
    @Override
    public int insertElementIsisPortMeasure(ElementIsisPortMeasure elementIsisPortMeasure)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementIsisPortMeasure.getId())) {
            elementIsisPortMeasure.setId(uuid);
        }
        elementIsisPortMeasure.setCreateBy(SecurityUtils.getUsername());
        elementIsisPortMeasure.setCreateTime(DateUtils.getNowDate());
        elementIsisPortMeasure.setUpdateBy(SecurityUtils.getUsername());
        elementIsisPortMeasure.setUpdateTime(DateUtils.getNowDate());
        return elementIsisPortMeasureMapper.insertElementIsisPortMeasure(elementIsisPortMeasure);
    }

    /**
     * 修改网元-ISIS接口配置-宽度量配置
     * 
     * @param elementIsisPortMeasure 网元-ISIS接口配置-宽度量配置
     * @return 结果
     */
    @Override
    public int updateElementIsisPortMeasure(ElementIsisPortMeasure elementIsisPortMeasure)
    {
        elementIsisPortMeasure.setUpdateBy(SecurityUtils.getUsername());
        elementIsisPortMeasure.setUpdateTime(DateUtils.getNowDate());
        return elementIsisPortMeasureMapper.updateElementIsisPortMeasure(elementIsisPortMeasure);
    }

    /**
     * 批量删除网元-ISIS接口配置-宽度量配置
     * 
     * @param ids 需要删除的网元-ISIS接口配置-宽度量配置主键
     * @return 结果
     */
    @Override
    public int deleteElementIsisPortMeasureByIds(String[] ids)
    {
        return elementIsisPortMeasureMapper.deleteElementIsisPortMeasureByIds(ids);
    }

    /**
     * 删除网元-ISIS接口配置-宽度量配置信息
     * 
     * @param id 网元-ISIS接口配置-宽度量配置主键
     * @return 结果
     */
    @Override
    public int deleteElementIsisPortMeasureById(String id)
    {
        return elementIsisPortMeasureMapper.deleteElementIsisPortMeasureById(id);
    }
}
